<%@include file="/pages/common/commons.jsp"%>
<html>
<head>
<title>闲你妹-注册</title>
<link type="text/css" rel="stylesheet" href="${static_domain}/scripts/beeTips/jquery.beeTips.css?v=${version}" />
<script type="text/javascript" src="${static_domain}/scripts/beeTips/jquery.beeTips.js?v=${version}"></script>
<script type="text/javascript" src="${static_domain}/scripts/jquery.form.js?v=${version}"></script>
<script type="text/javascript">
	$j(function() {
		var vitems = eval("(" + '${vitems}' + ")");
		
		$j("#bgForm").beeTips({initVals: vitems});

		$j("#bgForm").ajaxForm({
			type : 'POST',
			dataType : 'json',
			beforeSubmit : validate,
			success : function(result, status) {
				if (result.result != null) {
					if (result.result == 0) {
						window.location.href = result.lastUrl;
					} else if (result.result == 3 || result.result == 2) {
						$j("#loginForm").beeWarn(result.errors);
					}
					if (result.msg != null) {
						sAlert(result.msg);
					}
				} else {
					sAlert("返回结果异常");
				}
			}
		});

		function validate(formData, jqForm, options) {
			var pwdEq = $j("#memPwd").val() ==$j("#rePwd").val();
			if (!pwdEq) {
				$j("#rePwd").parent().find('.beeTipsDivWarn').css('visibility', 'visible');
			}
			return pwdEq && $j("#bgForm").beeCheck();
		}
	});
</script>
</head>
<div class="content">
	<p class="content-top"></p>
	<div class="content-bg">
		<form id="bgForm" autocomplete="off" action="registering.json" method="POST" spellcheck="false" enctype="application/x-www-form-urlencoded">
			<div>
				<div class="loading-page-denglu">
					<span class="loading fLeft">
						<c:choose>
							<c:when test="${sessionScope.oauthprofile != null}">完善注册信息</c:when>
							<c:otherwise>注册</c:otherwise>
						</c:choose> 
					</span>
					<span class="loading-word fRight">
						已是会员？<em><a href="login.htm" style="display: inline;color: black;line-height: 24px;">立即登录</a></em>
					</span>
				</div>
				<ul class="form_fields">
					<li><label for="loginName">登录名：</label> <input type="text" name="loginName" id="loginName"></li>
					<li><label for="email">邮箱：</label> <input type="text" name="email" id="email" maxlength="50"></li>
					<li><label for="pwd">密码：</label> <input type="password" maxlength="12" name="memPwd" id="memPwd"></li>
					<li><label for="rePwd">重复密码：</label> <input type="password" maxlength="12" name="rePwd" id="rePwd"></li>
					<li class="content-group-li">
						<label>验证码：</label>
						<input id="code_input" class="user-input-0407 text-remove fLeft" type="text" maxlength="4" name="captcha" />
						<div class="vcodeImage">
							<img id="vimg" class="hand" src="${http_domain}/captcha" onclick="changeImage(this);" />
						</div>
					</li>
					<li><input type="submit" class="loading-botton" value="注册"></li>
				</ul>
			</div>
		</form>
	</div>
	<p class="content-bottom"></p>
</div>
</html>